-
Notifications
You must be signed in to change notification settings - Fork 470
document CURSOR WITH HOLD #19590
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
document CURSOR WITH HOLD #19590
Conversation
Files changed:
|
✅ Deploy Preview for cockroachdb-api-docs canceled.
|
✅ Deploy Preview for cockroachdb-interactivetutorials-docs canceled.
|
@DrewKimball @dikshant I also want to update the CURSOR sql diagram in a separate |
✅ Netlify Preview
To edit notification comments on pull requests, go to your Netlify site configuration. |
Yes, I think so. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1 point of confusion that may need clarification.
src/current/v25.2/cursors.md
Outdated
~~~ | ||
</section> | ||
|
||
Declare a cursor using `WITH HOLD` to keep it open after the `COMMIT`: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the Implicit section, it is confusing to see "to keep it open after the COMMIT
". In the implicit example, each statement is an implicit transaction and has its own implicit commit. There is no actual COMMIT
command listed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That reminds me of some other details that may be worth mentioning - if a transaction aborts, all cursors opened within that txn are also rolled back. However, holdable cursors from previously committed transactions remain open. In addition, if a holdable cursor results in an error as it's being persisted, it will cause the current txn (implicit or explicit) to be rolled back.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks both! Incorporated these changes.
146458: docgen: expose WITH/WITHOUT HOLD syntax in SQL cursor diagram r=DrewKimball a=taroface This PR exposes the WITH HOLD / WITHOUT HOLD syntax in the DECLARE ... CURSOR diagram as follows: <img width="903" alt="image" src="https://github.com/user-attachments/assets/92c448fa-143b-47bb-aa8a-38b68542e123" /> Relates to cockroachdb/docs#19590. Epic: none Release note: none Release justification: non-production code change Co-authored-by: Ryan Kuo <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
DOC-13183